# Constants header
# - Put all constants in here
# - Works by defining a class with Xattr methods for checking const
# - This class is put in place as this module.
class _constants:
   class ConstError(TypeError): pass
   def __setattr__(self,name,value):
      if self.__dict__.has_key(name):
         raise self.ConstError, "Can't rebind const(%s)"%name
      self.__dict__[name]=value
   def __delattr__(self,name):
      if self.__dict__.has_key(name):
         raise self.ConstError, "Can't delete const(%s)"%name
         
   
   def __init__(self):
      self.NullFC = None
   
import sys
sys.modules[__name__]=_constants()

## that's all -- now any client-code can
#import const
## and bind an attribute ONCE:
#const.magic = 23
## but NOT re-bind it:
#const.magic = 88      # raises const.ConstError
## you may also want to add the obvious __delattr__
